<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('薪资套列表')"/>
    <th:block th:include="include :: select2-css"/>
</head>
<body class="gray-bg">
<div class="ui-layout-center">
    <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="user-form">
                    <input type="hidden" id="ComPidorDepTid" name="ComPidorDepTid">
                    <div class="select-list">
                        <ul>
                            <li>
                                员工编号：<input type="text" name="Badge"/>
                            </li>
                            <li>
                                姓名：<input type="text" name="Name"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                        class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                        class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>
            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-info" onclick="$.table.importExcel()" shiro:hasPermission="system:empSalary:import">
                    <i class="fa fa-upload"></i> 导入
                </a>
                <a class="btn btn-warning" onclick="exportExcel()" shiro:hasPermission="system:empSalary:export">
                    <i class="fa fa-download"></i> 选择人员
                </a>
            </div>

            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table" data-mobile-responsive="true"></table>
            </div>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: layout-latest-js"/>
<th:block th:include="include :: ztree-js"/>
<th:block th:include="include :: select2-js"/>


<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('empSalary:edit')}]];
    var removeFlag = [[${@permission.hasPermi('empSalary:remove')}]];
    var prefix = ctx + "empSalary";

    $(function () {
        var panehHidden = false;
        if ($(this).width() < 800) {
            panehHidden = true;
        }
        $('body').layout({initClosed: panehHidden, west__size: 350});
        queryEmpSalayInfoList();
    });

    function queryEmpSalayInfoList() {
        var options = {
            code: "id",
            uniqueId: "id",
            url: prefix + "/list",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove/{id}",
            importUrl: prefix + "/importData",
            importTemplateUrl: prefix + "/importTemplate",
            showSearch: false,
            showRefresh: false,
            showToggle: false,
            showColumns: false,
            pagination: false,
            height: 700,
            modalName: "基本信息",
            columns: [{
                checkbox: true
            }, {
                field: 'eid',
                title: '员工编号',
            },
                {
                    field: 'empName',
                    title: '姓名'
                },
                {
                    field: 'empDate.month',
                    title: '月份'
                },
                {
                    field: 'empDate.days',
                    title: '工作天数'
                },
                {
                    field: 'empDate.tdays',
                    title: '请假天数'
                },
                {
                    field: 'basePay',
                    title: '基本工资'
                },
                {
                    field: 'postSalary',
                    title: '岗位工资'
                },
                {
                    field: 'meritPay',
                    title: '绩效工资'
                },
                {
                    field: 'totalPay',
                    title: '实发工资'
                }]
        };
        $.table.init(options);
    }

    function exportExcel(){
        var url = ctx + "empSalary/exEmp";
        var options = {
            title: '选择人员',
            width: "450",
            url: url
        };
        $.modal.openOptions(options);
    }


    $('#btnExpand').click(function () {
        $._tree.expandAll(true);
        $(this).hide();
        $('#btnCollapse').show();
    });

    $('#btnCollapse').click(function () {
        $._tree.expandAll(false);
        $(this).hide();
        $('#btnExpand').show();
    });

    $('#btnRefresh').click(function () {
        queryDeptTree();
    });
</script>

</body>

<script id="importTpl" type="text/template">
    <form enctype="multipart/form-data" class="mt20 mb10">
        <div class="col-xs-offset-1">
            <input type="file" id="file" name="file"/>
            <div class="mt10 pt5">
                <input type="checkbox" id="updateSupport" name="updateSupport" title="如果登录账户已经存在，更新这条数据。"> 是否更新已经存在的用户数据
                &nbsp;	<a onclick="$.table.importTemplate()" class="btn btn-default btn-xs"><i class="fa fa-file-excel-o"></i> 下载模板</a>
            </div>
            <font color="red" class="pull-left mt10">
                提示：仅允许导入“xls”或“xlsx”格式文件！
            </font>
        </div>
    </form>
</script>
</html>